$(document).ready(function() {

	$('#checkAll').click(function() {
		var checked = $(this).attr('checked');
		$('input[name^=oid]').each(function() {
			if (checked == 'checked') {
				$(this).attr('checked', 'checked');
			} else {
				$(this).removeAttr('checked');
			}
		});
	});

});

function dialog(content, yesFn, noFn) {
	var width = 200;
	if (!noFn) {
		art.dialog( {
			time : 1,
			width : width,
			content : content,
			yesFn : yesFn
		});
	} else {
		art.dialog( {
			width : width,
			content : content,
			yesFn : yesFn,
			noFn : noFn
		});
	}
}

function order_by(type) {
	var orderBy = $('#orderBy');
	var order = $('#order');
	var orderVal = order.val();

	orderBy.val(type);
	if (orderVal == '') {
		order.val('asc');
	} else {
		if (orderVal == 'asc') {
			order.val('desc');
		}
		if (orderVal == 'desc') {
			order.val('asc');
		}
	}
	$('#pageNo').val(1);
	$('#mainForm').submit();
}